<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport"
        content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
	<link rel="stylesheet" type="text/css" href="../../css/api.css" />
	<link rel="stylesheet" type="text/css" href="../../css/common.css" />
	<link rel="stylesheet" type="text/css" href="../../css/aui.css" />
  <title>活动详情</title>
  <style>
		html, body {width: 100%;min-height: 100%;background: #fff;}
		.h20 {height: 0.5rem;background: #f0f0f0;margin: 0 -1rem;;}

    #header_top {
        background: #2997e4;
        padding-top: 25px;
    }
    .detail_con {
      padding: 1rem;
    }
    .detail_title h3 {
      font-size: 0.9rem;
      color: #333;
    }
    .detail_price h5 {
      font-size: 0.75rem;
      color: #333;
      margin: 1rem 0;
    }
    .detail_addtime h5 {
      font-size: 0.6rem;
      color: #999;
      margin: 1rem 0;
    }
    .detail_time h5 {
      font-size: 0.75rem;
      color: #333;
      margin: 1rem 0;
    }
    .detail_address h5 {
      font-size: 0.75rem;
      color: #333;
      margin: 1rem 0;
    }
    .detail_tit_sm h4 {
      font-size: 0.75rem;
      color: #333;
      font-weight: bold;
      line-height: 1.2rem;
    }
    .detail_text p {
      font-size: 0.75rem;
      line-height: 1.2rem;
      color: #333;
      margin: 1rem 0;
    }
    .detail_tit_sm h4 {
      margin: 1rem 0;
    }

    .ml_btns::before,
    .ml_btns::after {
      content: '';
      display: block;
      height: 0;
      clear: both;
    }
    .ml_btns {
      position: fixed;
      bottom: 0;
      width: 100%;
    }
    .ml_btn {
      background: #f0f0f0;
      float: left;
      width: 50%;
      padding: 0.5rem 0;
      text-align: center;
      color: #666;
    }
    .ml_btn:nth-child(2) {
      background: #2997e4;
      color: #fff;
    }
	</style>
</head>
<body>
  <div id="app" v-cloak>
<header id="header_top" class="aui-bar aui-bar-nav" >

  <a class="aui-pull-left"  onclick="goback()">
      <span class="aui-iconfont aui-icon-left"></span>
  </a>
  <div class="aui-title" id="title">
  活动详情
</div>
    <a class="aui-pull-right" @click="openMore(id)">
        <span class="aui-iconfont aui-icon-more"></span>
    </a>
</header>
<div class="detail_con">
  <div class="detail_title">
    <h3>{{info.title}}</h3>
  </div>
  <div class="detail_addtime">
    <h5>{{info.create_date}}</h5>
  </div>
  <div class="detail_time">
    <h5>时间: {{info.apply_date}} ~ {{info.activity_end_date}}</h5>
  </div>
  <div class="detail_address">
    <h5>地点: {{info.address}}</h5>
  </div>
  <div class="detail_price">
    <h5>价格: ￥{{info.apply_cost}} </h5>
  </div>
  <div class="h20"></div>
  <div class="detail_tit_sm">
    <h4>活动简介</h4>
  </div>
  <div class="detail_text" v-html="info.activity_details"></div>
</div>
<div class="ml_btns">
  <div class="ml_btn">咨询</div>
  <div class="ml_btn" @click="openDetail('wybm', '我要报名', id)">我要报名</div>
</div>
</div>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/vue.min.js"></script>
<script type="text/javascript" src="../../script/utils.js"></script>
<script type="text/javascript" src="../../script/common.js"></script>
<script>
apiready = function() {
  // console.log(api.pageParam.id)
  var app = new Vue({
    el: '#app',
    data: {
      id: api.pageParam.id,
      info: {}
    },
    created: function() {
      var $_this = this;
      api.ajax({
        url: window.Url.getActivityDetail + $_this.id,
        timeout: 300,
      }, function(ret, err) {
          if (ret) {
              // api.alert({ msg: JSON.stringify(ret) });
              $_this.info = ret.data
          } else {
              api.alert({ msg: JSON.stringify(err) });
          }
      })
    },
    methods: {
      openDetail:function (type, title, id, data) {
        var $_this = this
        api.openWin({
          name: 'index_detail_' + type,
          pageParam: {
            name: 'index_detail_' + type,
            title: title,
            id: id,
            data: $_this.info
          },
          url: './first_header.html',
          delay: 200,
          bounces: false
        });
      },

      openMore: function (id) {
        api.openFrame ({
                name: 'more',
                url: './more.html',
                rect:{
                    x:0,
                    y:44,
                    w:'auto',
                    h:'auto'
                },
                pageParam: {
                  id: id,
                  type: 'hd'
                },
                bounces: false,
                delay:200
            })
      }
    },
    filters: {
      time: function (value) {
        value = new Date(value)
        return value.getFullYear() + '-' + value.getMonth() + '-' + value.getDate() + ' ' + value.getHours() + ':' + value.getMinutes() + ':' + value.getSeconds()
      }
    }
  })
}
function openMore () {
  api.openFrame ({
          name: 'more',
          url: './more.html',
          rect:{
              x:0,
              y:44,
              w:'auto',
              h:'auto'
          },
          bounces: false,
          delay:200
      })
}

</script>
</body>
</html>
